package android.slc.user.ui.user.adapter

import android.slc.adapter.SelectBox
import android.slc.extras.user.entity.UserInfo
import android.slc.user.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.module.LoadMoreModule
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.google.android.material.checkbox.MaterialCheckBox

/**
 *
 * @Description:
 * @Author: sunlunchang
 * @CreateDate: 2021/12/07 下午 1:38
 *
 */
class UserInfoMultipleAdapter(data: MutableList<SelectBox<UserInfo>>) :
    BaseQuickAdapter<SelectBox<UserInfo>, BaseViewHolder>(
        R.layout.user_item_user_info_select_multiple, data
    ), LoadMoreModule {

    private val userInfoBrowserProvider = UserInfoBrowserProvider()

    override fun convert(holder: BaseViewHolder, item: SelectBox<UserInfo>) {
        val userInfo = item.data
        userInfoBrowserProvider.convert(holder, userInfo)
        val checkBox: MaterialCheckBox = holder.getView(R.id.checkbox)
        checkBox.isChecked = item.isChecked
    }
}
